//
//  ZXLSecurityClient.h
//  SignSecurityDemo
//
//  Created by zxl02 on 2020/8/14.
//  Copyright © 2020 CordovaDemo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ZXLSecurityEnum.h"
#import "ZXLConfig.h"
#import "ZXLSignTools.h"
#import "ZXLAPISecurityManager.h"
#import "ZXLFileSecurityManager.h"
#import "ZXLSignData.h"
NS_ASSUME_NONNULL_BEGIN

#define SecurityClientConfig  [ZXLSecurityClient sharedClient].securityConfig

#define AES_KEY @""

#define RSA_PUB_KEY @""
#define RSA_PRIV_KEY @""

#define DES_PRIV_KEY @""

typedef void(^SignResultBlock)( SignResult * res);

@interface ZXLSecurityClient : NSObject
@property(nonatomic, strong) ZXLAPISecurityManager *apiManager;
@property(nonatomic, strong) ZXLFileSecurityManager *fileManager;
@property(nonatomic, strong) ZXLConfig *securityConfig;

+ (instancetype)sharedClient;

-(SignResult*)getsignResultStrWithScene:(SecuritySceneType)sceneType  signEntity:(ZXLSignData*)signEntity;


//获取当前时间戳
- (NSString *)currentTimeStr;

//获取随机数
- (NSString *)getArc4random;


//加签
/*
/// sign v2
/// @param signURL url
/// @param signBody body
/// @param signType application/x-www-form-urlencoded (1) 格式  application/json (2)格式
-(NSString*)getSignatureWithSignURL:(NSString*)signURL signBody:(NSDictionary*)signBody signType:(NSInteger)signType;

/// RSA,加解密
/// @param method 加密或者解密
/// @param key 公钥/私钥  - 不对称加密 加解密传相反Key
/// @param keyType pub-YES  priv-NO
/// @param completion 返回结果 字符串,data
- (void)RSASecuritySign:(SecuritySignMethod)method text:(NSString*)text  Key:(NSString*)key keyType:(BOOL)keyType completion:(SignResultBlock)completion;


/// DES或者3DES
/// @param method 加密或者解密
/// @param is3DES 是否3DES
/// @param text 加密字符串
/// @param key key
/// @param completion 返回结果
- (void)DESSecuritySign:(SecuritySignMethod)method is3DES:(BOOL)is3DES text:(NSString*)text  Key:(NSString*)key completion:(SignResultBlock)completion;


/// AES
/// @param method 加密或者解密
/// @param text 加密字符串
/// @param key key
/// @param keySize SignLength
/// @param completion 返回结果
-(void)AESSecuritySign:(SecuritySignMethod)method text:(NSString*)text  Key:(NSString*)key keySize:(SecuritySignLengthAES)keySize completion:(SignResultBlock)completion;

*/

@end

NS_ASSUME_NONNULL_END
